<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>选择器</title>
    <script type="text/javascript" src="../js/jquery-3.4.1.min.js"></script>
    <script>
        $(function(){
            console.log($("#d1"))
            console.log($(".c1"))
            console.log($("p"))
            console.log($("*"))
            console.log($("#d1,.c1"))
            console.log($(".c2 span"));
            console.log($(".c2>span"));
            console.log($("#s1+span"))
            console.log($("#s1~span"))
            console.log($("p[name='p1']"))
            console.log($("li:first"))
            console.log($("li:last"))
            console.log($("li:even"))
            console.log($("li:odd"))
        })
    </script>
</head>
<body>
<div id="d1">这是id为d1的div</div>
<div class="c1">这是class为c1的div</div>
<div class="c1">这是class为c1的div</div>
<p>第1个段落</p>
<p>第2个段落</p>
<p>第3个段落</p>
<hr>
<div class="c2">
    <span>这是class为c2的div中的span</span>
    <div>
        <span>这是class为c2的div中的div中的span</span>
    </div>
</div>
<span id="s1">这是id为s1的span</span><br>
<span>这是span</span><br>
<span>这是span</span><br>
<p name="p1">这是name为p1的段落</p>
<ul>
    <li>item0</li>
    <li>item1</li>
    <li>item2</li>
    <li>item3</li>
    <li>item4</li>
    <li>item5</li>
</ul>
</body>
</html>